﻿Public Class formverifyuser

    Private Sub btnverify_Click(sender As Object, e As EventArgs) Handles btnverify.Click


        Dim result As String

        Dim ipverify As String
        ipverify = textipverify.Text

        richtext.Text = "tech tools maikito"
        lbnverify.Text = ""
        If textipverify.Text = "" Then
            MsgBox("Please inser IP Address", MsgBoxStyle.Exclamation)
            Return
        End If

        Dim NewProcess As New System.Diagnostics.Process()
        With NewProcess.StartInfo
            .FileName = "c:\windows\psloggedon.exe"
            .Arguments = "\\" & ipverify
            .RedirectStandardOutput = True
            .RedirectStandardError = True
            .RedirectStandardInput = True
            .UseShellExecute = False
            .WindowStyle = ProcessWindowStyle.Normal
            .CreateNoWindow = True
        End With

        If My.Computer.Network.Ping(ipverify) = True Then
            NewProcess.Start()
            System.Threading.Thread.Sleep(2000)



            result = NewProcess.StandardOutput.ReadToEnd
            richtext.Text = result

        Else
            lbnverify.Text = "IP Address is shutdown or Incorrect"

        End If


            




            'NewProcess.StandardOutput.ReadToEnd)






            textipverify.Clear()



    End Sub

    Private Sub Redirect(streamReader As IO.StreamReader, p2 As Object)
        Throw New NotImplementedException
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        richtext.Clear()
        textipverify.Clear()

        Me.Close()

    End Sub
End Class